#define  _CRT_SECURE_NO_WARNINGS
#include"List.h"
void testLTNode1()
{
	LTNode* phead = LTInit();
	LTPushBack(phead, 1);
	LTPushBack(phead, 2);
	LTPushBack(phead, 2);
	LTPushBack(phead, 3);
	LTPushBack(phead, 4);
	LTPrint(phead);

	LTPopBack(phead);
	LTPopBack(phead);
	LTPopBack(phead);
	LTPrint(phead);

	LTPushFront(phead, 1);
	LTPushFront(phead, 2);
	LTPushFront(phead, 3);
	LTPushFront(phead, 4);
	LTPrint(phead);

	LTPopFront(phead);
	LTPopFront(phead);
	LTPrint(phead);
}

void testLTNode2()
{
	LTNode* phead = LTInit();
	LTPushFront(phead, 1);
	LTPushFront(phead, 2);
	LTPushFront(phead, 3);
	LTPushFront(phead, 4);
	LTPrint(phead);
	LTNode* pos = LTFind(phead, 3);
	if (pos)
	{
		pos->data *= 10;
	}
	LTPrint(phead);

	pos = LTFind(phead, 30);
	LTErase(pos);
	LTPrint(phead);

	pos = LTFind(phead, 4);
	LTInsert(pos, 3);
	LTPrint(phead);

	pos = NULL;
	LTDestroy(phead);
	phead = NULL;
}

int main()
{
	//testLTNode1();
	testLTNode2();
	return 0;
}